package main.java.indi.zyj.c150.dps;

import java.util.Scanner;

public class _14_BlackWhiteQueen {


    static int[][] chessboard = new int[10][10];
    static int[] vx = new int[10];
    static int[] vy = new int[20];
    static int[] vd1 = new int[20];
    static int[] vd2 = new int[20];
    static int ans, n;


    static void Dfs(int x, int y, int p){
        if (x == n){
            ans++;
            return;
        }
        if (y == n){
            Dfs(x + 1, 0, p);
            return;
        }
        if (chessboard[x][y] == 0){
            Dfs(x, y + 1, p);
            return;
        }
        for (int i = 1; i <= n; i++) {

        }
    }


    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        n = scan.nextInt();


        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                chessboard[i][j] = scan.nextInt();
            }
        }

        Dfs(0, 0, 1);

    }



}
